﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace Project_Udrinkwater
{
    public class Accounting
    {
        string Connection = ConfigurationManager.ConnectionStrings["DB_Udrink"].ConnectionString;
        public DataTable GetData_ChDate()
        {
            string sqltext = @"SELECT TOP 1 [ID]
                            ,[Date_Account]
                            ,[Last_Account]
                            ,[Detail_List]
                            ,[Money Detail]
                            ,[Status]
                            FROM [DB_Udrink].[dbo].[TB_accounting]
                            ORDER BY Date_Account DESC";
            SqlConnection sqlconn = new SqlConnection(Connection);
            SqlDataAdapter da = new SqlDataAdapter(sqltext, sqlconn);
            DataSet ds = new DataSet();
            da.Fill(ds);

            return ds.Tables[0];

        }
    }
}